# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: xguo

from coin.exchange.base.kr_rest.currency import NativeCurrency
from coin.exchange.deribit_v1.kr_rest.constants import currency_list


def to_native_currency(currency_str):
  assert currency_str in currency_list, currency_str
  native_currency_str = currency_str
  return native_currency_str


def from_native_currency(native_currency_str):
  currency_str = native_currency_str
  assert currency_str in currency_list, native_currency_str
  return currency_str


class DeribitCurrency(NativeCurrency):
  _exchange = "Deribit"

  @classmethod
  def FromStrCurrencyImpl(cls, currency_str, current_datetime):
    return cls(currency_str, to_native_currency(currency_str))

  @classmethod
  def FromStrNativeCurrencyImpl(cls, native_currency_str, current_datetime):
    return cls(from_native_currency(native_currency_str), native_currency_str)
